$(document).ready(
	function(){
		$('#search_content').on('keypress',function(event){
			if(event.keyCode == 13){
				window.location.href = "index?search_content="+$(this).val();
			}
		});

		$('#search_content').on('blur',function(event){
			window.location.href = "index?search_content="+$(this).val();
		});

		$('#a-to-add').on('click',function(event){
			event.preventDefault();
			$.ajax({
				url:$(this).attr('href'),
				type:'GET',
				data:{mainhost:$('#mainhost').val(),branchhost:$("#branchhost").val(),inuser:$('#inuser').val(),owngroup:$('#owngroup').val()},
				success: function(data){
					alert(data.data);
					window.location.href ='index?p=1';
				}
			});
		});
	});